from enum import Enum

class TokenType(Enum):
    ERR = "ERR"
    EOF = "EOF"
    IDENTIFIER = "IDENTIFIER"

    # 关键字
    KW_INT = "KW_INT"
    KW_CHAR = "KW_CHAR"
    KW_STRING = "KW_STRING"
    KW_BOOL = "KW_BOOL"
    KW_VOID = "KW_VOID"

    # 常量
    NUMBER = "NUMBER"
    CHAR = "CHAR"
    STRING = "STRING"

    # 赋值
    ASSIGN = "ASSIGN"

    # 单目运算
    NOT = "NOT"
    AMPERSAND = "AMPERSAND" # 取地址符

    # 算术运算符，正负号也是作为算术运算符处理的。
    ADD = "ADD"
    SUB = "SUB"
    MULTIPLY = "MULTIPLY"
    DIVIDE = "DIVIDE"
    MODULO = "MODULO"

    # 自增自减
    INC = "INC"
    DEC = "DEC"

    # 比较运算符
    GT = "GT"
    GE = "GE"
    LT = "LT"
    LE = "LE"
    EQUAL = "EQUAL"
    NOT_EQUAL = "NOT_EQUAL"

    # 逻辑运算符
    AND = "AND"
    OR = "OR"

    # ()
    LPAREN = "LPAREN"
    RPAREN = "RPAREN"

    # []
    LBRACK = "LBRACK"
    RBRACK = "RBRACK"

    # {}
    LBRACE = "LBRACE"
    RBRACE = "RBRACE"

    # , : ;
    COMMA = "COMMA"
    COLON = "COLON"
    SEMI = "SEMI"

    # if else
    KW_IF = "KW_IF"
    KW_ELSE = "ELSE"

    # switch case default
    KW_SWITCH = "KW_SWITCH"
    KW_CASE = "KW_CASE"
    KW_DEFAULT = "KW_DEFAULT"

    # while for
    KW_WHILE = "KW_WHILE"
    KW_FOR = "KW_FOR"

    # break continue return
    KW_BREAK = "KW_BREAK"
    KW_CONTINUE = "KW_CONTINUE"
    KW_RETURN = "KW_RETURN"